package com.ofek.eventos;

import java.io.Serializable;

import android.content.Context;

import com.ofek.applicationbase.forms.SimpleQuestionView;
import com.ofek.eventos.db.datatypes.helptypes.TextFieldInEvent;

public class TextQuestionView extends SimpleQuestionView {


	private TextFieldInEvent textFieldInEvent;
	public TextQuestionView(final int questionStringId, final int inputType,
			final Context context) {
		super(questionStringId, inputType, context);
	}
	public TextQuestionView(final int questionStringId, final int inputType,
			final Context context, final boolean required) {
		super(questionStringId, inputType, context, required);
	}
	public TextQuestionView(final String questionStringId, final int inputType,
			final Context context, final boolean required) {
		super(questionStringId, inputType, context, required);
	}
	@Override
	public Serializable getAnswer() {
		final Serializable answer = super.getAnswer();
		if (answer==null) return null;
		textFieldInEvent.value = (String)answer; 
		return textFieldInEvent;
	}
	@Override
	public void setAnswer(final Object defaultAnswer) {
		textFieldInEvent = (TextFieldInEvent) defaultAnswer;
		super.setAnswer(((TextFieldInEvent)defaultAnswer).value);
	}

}
